﻿namespace FreesenseSubAIS.SocketModel
{
    public class Server
    {
        private static readonly Server _server = new Server();
        public static Server Intrance
        {
            get { return _server; }
        }
        public bool OnServer;
        public ServerMgr SerMgr;
        public bool Connect(string ip, int port)
        {
            SerMgr = new ServerMgr(ip,port);
            OnServer= SerMgr.open();
            return OnServer;
        }
        public void Disconnect()
        {
            try
            {
                if (SerMgr != null)
                    SerMgr.close();
            }
            catch
            { }
        }

    }
}
